<template>
	<view :class="bgTabVal==2?'fullsize noRepeat':bgTabVal==1?'repeat ysize':'noRepeat ysize'"
		:style="'background-color:'+bgColor+';background-image: url('+bgPic+');min-height:'+windowHeight+'px;'" id="home">
		<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton" bgcolor="transparent"></skeleton>
		
		<view v-if="!errorNetwork" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
			<view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
				<block>
					<!-- #ifdef H5 -->
					
					<!-- #endif -->
					<!-- #ifdef MP || APP-PLUS -->
					<view class="slider-container" v-if="award_user_list.length">
						<view class="slider-track">
							<view class="slider-item" v-for="(item, index) in award_user_list" :key="index">
								<view class="slider-item-image">
									<image :src="item.avatar" />
								</view>
								<view class="slider-item-message">{{item.title}}</view>
							</view>
						</view>
					</view>
					<homeComb class="home-comb" v-if="smallPage" :isScale="isScale" :isMenu="isMenu" :dataConfig="homeCombData" :isFixed="isFixed" :isScrolled="isScrolled" :userInfo="userInfo" :locationAddress="locationAddress" @getLocationAddress="getLocationAddress" @changeAddress="changeAddress" :labelList="label_list" :tabId="tabId" @changeDiy="changeDiy"	@bindHeight="bindHeighta" @openAuto1="openAuto1"></homeComb>
					<!-- <view class="common-content">
						<view class="common-head">
							<view class="common-title"><view class="common-title-name">客户推荐</view></view>
							
							<view class="common-head-more" @click="goUrl('/pages/extends/user/recommend_user')"><image src="https://img.jukee.net/def/3f5fd202311271239383266.png" /></view>
						</view>
						<view class="list_user_content" v-if="recommendCustomData.count">
							<swiper class="swiper_list_user" circular>
								<swiper-item class="list_user" v-for="(item, index) in recommendCustomData.list" :key="index">
									<view class="list_user_item" v-for="(v, k) in item" :key="k" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid)">
										<view class="list_user_avatar"><img :src="v.avatar ? v.avatar : '/static/images/f.png'" /></view>
										<view class="list_user_nickname line1">{{v.nickname}}</view>
										<view class="list_user_label line1">{{v.label[0]}}</view>
									</view>
								</swiper-item>
							</swiper>
						</view>
						<view style="min-height: 30rpx;" v-else></view>
					</view> -->
					<view class="news-rd-u" style="padding-bottom: 0rpx;">
						<view class="news-rd-u-ad acea-center" v-if="tabId == -1">
							<image src="https://ly.jukee.net/static/homeimg001.png" @click="goUrl('/pages/extends/community/community_demand?is_label=2')"/>
							<image src="https://ly.jukee.net/static/homeimg002.png" @click="goUrl('/pages/users/customer_invite/index')"/>
							<image src="https://ly.jukee.net/static/homeimg003.png" @click="goUrl('/pages/extends/user/recommend_user')"/>
						</view>
						<view class="news-rd-u-ad acea-center" style="grid-gap: 10rpx;" v-else>
							<image src="https://ly.jukee.net/static/homeimg001.png" @click="goUrl('/pages/extends/community/community_demand?label_id='+tabId)"/>
							<image src="https://ly.jukee.net/static/homeimg002.png" @click="goUrl('/pages/users/customer_invite/index')"/>
							<image src="https://ly.jukee.net/static/homeimg003.png" @click="goUrl('/pages/extends/user/recommend_user')"/>
						</view>
						<template v-if="article_list.length">
							<view class="common-content-margin" style="background-color: unset;padding-left: 0rpx;">
								<view class="common-head">
									<view class="common-title"><view class="common-title-name">行业快讯</view></view>
								</view>
							</view>
							<view class="article">
								<view class="article-item" v-for="(item, index) in article_list" :key="index" @click="goUrl('/pages/news_details/index?id=' + item.article_id)">{{item.title}}</view>
							</view>
						</template>
						<view class="common-content-margin" style="background-color: unset;padding: 0rpx;padding: 20rpx; 0">
							<view class="common-head">
								<view class="common-title"><view class="common-title-name">客户推荐</view></view>
								<view class="common-children-t" @click="goUrl('/pages/extends/user/recommend_user')">
									<view class="common-children-title">更多客户</view>
								</view>
								<view class="common-head-more" @click="goUrl('/pages/extends/user/recommend_user')"><image src="https://img.jukee.net/def/3f5fd202311271239383266.png" /></view>
							</view>
						</view>
						<view class="news-rd-ulist acea-center">
							<scroll-view scroll-x v-if="recommendCustomData.count">
								<view class="list-user">
									<view class="list_user_item" v-for="(v, k) in recommendCustomData.list" :key="k">
										<view class="list_user_avatar" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid+'&is_service=1')"><img :src="v.avatar ? v.avatar : (v.sex == 2 ? 'https://img.jukee.net/def/1acf8202312251748401249.png' : 'https://img.jukee.net/def/bd5e8202312251748397655.png')" /></view>
										<view class="list_user_nickname line1" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid+'&is_service=1')">{{v.nickname}}</view>
										<view class="list_user_label line1" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid+'&is_service=1')">{{v.label[1] ? v.label[1] : v.label[0]}}</view>
										<view class="tab-wx"  @click="getUserContactInformations(v, 'we_chat_account', 1)">加微信</view>
									</view>
								</view>
							</scroll-view>
							<!-- <swiper class="swiper_list_user" circular v-if="recommendCustomData.count">
								<swiper-item class="list_user acea-center" v-for="(item, index) in recommendCustomData.list" :key="index">
									<view class="list_user_item" v-for="(v, k) in item" :key="k">
										<view class="list_user_avatar" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid+'&is_service=1')"><img :src="v.avatar ? v.avatar : (v.sex == 2 ? 'https://img.jukee.net/def/1acf8202312251748401249.png' : 'https://img.jukee.net/def/bd5e8202312251748397655.png')" /></view>
										<view class="list_user_nickname line1" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid+'&is_service=1')">{{v.nickname}}</view>
										<view class="list_user_label line1" @click="goUrl('/pages/plantGrass/plant_user/index?id='+v.uid+'&is_service=1')">{{v.label[1] ? v.label[1] : v.label[0]}}</view>
										<view class="tab-wx"  @click="getUserContactInformations(v, 'we_chat_account', 1)">加微信</view>
									</view>
								</swiper-item>
							</swiper> -->
							<!-- <image class="news-rd-u-more" src="https://img.jukee.net/def/3f5fd202311271239383266.png" @click="goUrl('/pages/extends/user/recommend_user')" style="margin-left: 30rpx;"/> -->
						</view>
					</view>
					
					
					<view class="common-content-margin" style="background-color: unset;">
						<view class="common-head">
							<view class="common-title"><view class="common-title-name">客户订单</view></view>
							<!-- <view class="common-children-t">
								<view class="common-children-title" :class="demandType == 1 ? 'common-children-title-on' : ''" @click="clickDemandType(1)">合作</view>
								<view class="common-children-title" :class="demandType == 2 ? 'common-children-title-on' : ''" @click="clickDemandType(2)">兼职</view>
							</view> -->
							<view class="common-children-t" @click="goUrl('/pages/extends/community/community_demand?label_id='+tabId+'&type=' + (demandType == 2 ? 10 : ''))">
								<view class="common-children-title">更多订单</view>
							</view>
							<view class="common-head-more" @click="goUrl('/pages/extends/community/community_demand?label_id='+tabId+'&type=' + (demandType == 2 ? 10 : ''))"><image src="https://img.jukee.net/def/3f5fd202311271239383266.png" /></view>
						</view>
						<demand :list="recommendDemandData.list" :type="3"></demand>
					</view>
					
					<view class="common-content">
						<view class="common-head">
							<view class="common-title"><view class="common-title-name">{{tabId == - 1 ? '客户群' : '客户群'}}</view></view>
							<view class="common-children-t" @click="goUrl('/pages/goods_cate/goods_cate?activceCate=1')">
								<view class="common-children-title">更多客户群</view>
							</view>
							<view class="common-head-more" @click="goUrl('/pages/goods_cate/goods_cate?activceCate=1')"><image src="https://img.jukee.net/def/3f5fd202311271239383266.png" /></view>
						</view>
						<view class="list_user_content list_circle_content" v-if="recommendCircleData.count">
							<circleItem :type="2" :list="recommendCircleData.list"></circleItem>
						</view>
					</view>
					<!-- <view class="common-content-margin" >
						<view class="common-head">
							<view class="common-title"><view class="common-title-name">行业同城</view></view>
							<view class="common-children-t">
								<view class="common-children-title" :class="recommendDemandServiceType == 1 ? 'common-children-title-on' : ''" @click="clickRecommendDemandService(1)">商家</view>
								<view class="common-children-title" :class="recommendDemandServiceType == 3 ? 'common-children-title-on' : ''" @click="clickRecommendDemandService(3)">需求</view>
							</view>
							<view class="common-head-more" v-if="recommendDemandServiceType == 1" @click="goUrl('/pages/plantGrass/circle_demand_service/index?tab_index=1')"><image :src="domain + '/uploads/def/20230702/97c18c51de8da55ee03c7f5b0d3c03f8.png'" /></view>
							<view class="common-head-more" v-else @click="goUrl('/pages/plantGrass/circle_demand_service/index?tab_index=0')"><image :src="domain + '/uploads/def/20230702/97c18c51de8da55ee03c7f5b0d3c03f8.png'" /></view>
						</view>
						<service v-if="recommendDemandServiceType == 1" :list="recommendDemandServiceData.list" :type="4"></service>
						<demand v-if="recommendDemandServiceType == 3" :list="recommendDemandServiceData.list" :type="3"></demand>
					</view> -->
					<!-- <view class="common-content-margin" v-if="is_community_video_start == 1">
						<view class="common-head" style="margin-bottom: 50rpx;">
							<view class="common-title"><view class="common-title-name">行业视频</view></view>
							<view class="common-head-more" @click="goUrl('/pages/short_video/nvueSwiper/list?currentNav=2')"><image :src="domain + '/uploads/def/20230702/97c18c51de8da55ee03c7f5b0d3c03f8.png'" /></view>
						</view>
						<videoListComposer :list="recommendVideoData.list" :type='2'></videoListComposer>
					</view> -->
					<view class="common-content-margin">
						<view class="common-head">
							<view class="common-title"><view class="common-title-name">{{tabId == - 1 ? '热门头条' : '行业热榜'}}</view></view>
							<view class="common-children-t" @click="goUrl('/pages/extends/community/community_service?navActive='+(tabIdIndex-1))">
								<view class="common-children-title">更多服务</view>
							</view>
							<view class="common-head-more" @click="goUrl('/pages/extends/community/community_service?navActive='+(tabIdIndex-1))"><image src="https://img.jukee.net/def/3f5fd202311271239383266.png" /></view>
						</view>
						<service :list="recommendServiceData.list" :type="2" @hasBlockLine="hasBlockLine" @hasNoneLine="hasNoneLine" @setCommunityShare="setCommunityShare"></service>
					</view>
					
					<!-- #endif -->
					<view v-show="navIndex == 0" class="loadingicon acea-row row-center-wrapper" v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
						<text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
						{{ loadTitle }}
					</view>
				</block>
				
				<!-- #ifdef H5 -->
				<a v-if="beian_sn" href="https://beian.miit.gov.cn/#/Integrated/index" class="copyRight">{{beian_sn}}</a>
				<!-- #endif -->
				<!-- #ifndef H5 -->
				<view v-if="beian_sn" class="copyRight">{{beian_sn}}</view>
				<!-- #endif -->
				<view v-if="newData.status && newData.status.status" class="diyheight"></view>
			</view>
		</view>
		<view v-else>
			<view class="error-network">
				<image src="/static/images/error-network.png"></image>
				<view class="title">网络连接断开</view>
				<view class="con">
					<view class="label">请检查情况：</view>
					<view class="item">· 在设置中是否已开启网络权限</view>
					<view class="item">· 当前是否处于弱网环境</view>
					<view class="item">· 版本是否过低，升级试试吧</view>
				</view>
				<view class="btn" @click="reconnect">重新连接</view>
			</view>
		</view>
		<!-- #ifdef APP-PLUS -->
		<view class="privacy-wrapper" v-if="privacyStatus">
			<view class="privacy-box">
				<view class="title">用户协议与隐私政策</view>
				<view class="content">
					请务必审慎阅读、充分理解“用户协议 与 隐私政策”各条款，包括但不限于：为了 向你提供即时通讯、内容分享等服务，我 们需要收集你的设备信息、操作日志等个
					人信息。你可以在“设置”中查看、变更、 删除个人信息并管理你的授权。
					<br />
					你可以阅读
					<navigator url="/pages/users/user_about/index?from=sys_user_agree">《用户协议》</navigator>与<navigator url="/pages/users/user_about/index?from=sys_userr_privacy">《隐私政策》</navigator>
					了解 详细信息。如你同意，请点击“我同意”开始接受我们的服务。
				</view>
				<view class="btn-box">
					<view class="btn-item" @click="confirmApp">我同意</view>
					<view class="btn" @click="closeModel">随便逛逛</view>
				</view>
			</view>
		</view>
		<!-- #endif -->
		<!-- 发送给朋友图片 -->
		<view class="share-box" v-if="isIntegral">
			<!-- #ifndef H5 -->
			<image src="https://ly.jukee.net/static/images/share-info.png" @click="closeShare"></image>
			<!-- #endif -->
			<!-- #ifdef H5 -->
			<image src="/static/images/share-info-wechat.png" @click="closeShare"></image>
			<!-- #endif -->
		</view>
		<!-- 优惠券弹窗 -->
		<view class="coupon_popups" v-if="showCoupon">
			<view class="bg"></view>
			<view class="con" :style="{ 'background-image': `url(${domain}/static/diy/couponWindow${keyColor}.png)` }">
				<scroll-view scroll-y="true" >
					<view v-for="(item, index) in couponArray" :key="index" class="item">
						<view class="left">
							<view class="price">￥ <text>{{item.coupon_price}}</text></view>
							<view class="max_price" v-if="item.use_min_price > 0">满{{item.use_min_price}}可用</view>
							<view class="max_price" v-else>无门槛</view>
						</view>
						<view class="right">
							<view class="time line1" v-if="item.coupon_type">有效期{{item.use_start_time}} - {{item.use_end_time}}</view>
							<text class="coupon_type">{{couponTypeMsg[item.type] || '店铺券'}}</text>
							<navigator :url="'/pages/columnGoods/goods_coupon_list/index?coupon_id='+item.coupon_id" class='bnt1 b-color' hover-class="none"><text class="title titleSize">{{item.title}}</text>
							<view class="title titleColor">
								有效期:{{item.use_start_time}}-{{item.use_end_time}}
							</view>
							</navigator>
						</view>
					</view>
				</scroll-view>
				<view class="text">优惠券已放入您的账户中，点击“优惠券”去使用</view>
				<view class='iconfont icon-guanbi3' @click="showCoupon = false"></view>
			</view>
		</view>
		<userListPopup :is_user_recommend_popup="is_user_recommend_popup" :list="userRecommendPopupList" @closeUserRecommendPopup="closeUserRecommendPopup"></userListPopup>
		<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" :isGoIndex="false"></authorize>
		<!-- #ifndef H5 -->
		<passwordPopup></passwordPopup>
		<!-- #endif -->
		<!-- #ifdef MP -->
		<privacyMenu ref="privacyMenuPopup"/>
		<!-- #endif -->
		<!-- 发布弹窗 -->
		<publishPopup :isPublishPopup="isPublishPopup" @closePublishPopup="closePublishPopup"></publishPopup>
		<view class="foot" v-if="newData.status && newData.status.status">
			<view class="page-footer" id="target" :style="{'background-color':newData.bgColor.color[0].item}">
				<view class="foot-item" v-for="(item,index) in newData.menuList" :key="index"
					@click="goRouter(item, index)">
					<block v-if="![2,3].includes(index)">
						<block v-if="item.link == activeRouter">
							<image :src="item.imgList[0]"></image>
							<view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">{{item.name}}
							</view>
						</block>
						<block v-else>
							<span v-if="index == 4 && userInfo.log_count > 0" class="remind_tips">{{userInfo.log_count > 99 ? '99+' : userInfo.log_count}}</span>
							<image :src="item.imgList[1]"></image>
							<view class="txt" :style="{color:newData.txtColor.color[0].item}">{{item.name}}</view>
						</block>
					</block>
					<block v-else-if="index == 2">
						<image class="foot-item-add" :src="item.imgList[0]"></image>
						<view class="txt" style="font-size: 32rpx;margin-bottom: 40rpx;">发布</view>
					</block>
					<block v-else-if="index == 3">
						 <!-- && is_community_video_start == 1 -->
						<block v-if="item.link == activeRouter">
							<image :src="item.imgList[0]"></image>
							<view class="txt" :style="{color:newData.activeTxtColor.color[0].item}">{{item.name}}
							</view>
						</block>
						<block v-else>
							<image :src="item.imgList[1]"></image>
							<view class="txt" :style="{color:newData.txtColor.color[0].item}">{{item.name}}</view>
						</block>
					</block>
				</view>
			</view>
		</view>
		<view v-if="overflow" class="overflow-mask" @touchmove.stop.prevent="() => {}"></view>
		<view class="red_envelope_reward" v-if="!is_user_recommend_popup && red_envelope_reward_popup">
			<image class="red_envelope_ceng_img" src="https://img.jukee.net/default/385c6202309192016592971.png" mode="widthFix" @click="clickRedEnvelopeReward"/>
			<view class="red_envelope_ceng" @click="red_envelope_reward_popup = false"></view>
		</view>
		<!-- 需求推送提醒 -->
		<view class="demand-msg-popup" v-if="demand_msg.length && is_demand_msg == 1">
			<swiper class="demand-msg-swiper">
				<swiper-item class="demand-msg-swiper-item" v-for="(item,index) in  demand_msg" :key="index">
					<view class="demand-msg-content">
						<view class="demand-msg-close" @click="is_demand_msg = 0">
							<image src="https://ly.jukee.net/uploads/default/20230803/8d5635ef7c1504bfadbd85f0a04270cc.png" />
						</view>
						<view class="demand-msg-user">
							<view class="demand-msg-user-avatar">
								<image :src="item.user.avatar || '/static/images/f.png'" />
							</view>
							<view class="demand-msg-user-info">
								<view class="demand-msg-user-name line1">{{item.user.nickname}}</view>
								<view class="demand-msg-user-label">{{item.user.label_name.label_name}}</view>
							</view>
						</view>
						<view class="demand-msg-title">
							您的客户订单
						</view>
						<view class="demand-msg-content line3">{{item.content}}</view>
						<view class="demand-msg-btn" @click="goUrl('/pages/users/user_demand/index')">去查收</view>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 需求推送提醒end -->
		<!-- 手机号微信查看弹窗 -->
		<view class="popup_user_contact" v-if="is_popup_user_contact" @click="is_popup_user_contact=false">
			<view class="popup_user_contact_c">
				<view class="popup_user_contact_h">
					<view class="popup_user_contact_t">提示</view>
					<view class="popup_user_contact_u">{{popup_user_contact_type == 'phone' ? '电话：' : '微信号：'}}<text>{{popup_user_contact}}</text></view>
				</view>
				<view class="popup_user_contact_b">
					<view class="popup_user_contact_close" @click="is_popup_user_contact=false">取消</view>
					<view class="popup_user_contact_copy" @click="copyUserContact">复制</view>
				</view>
			</view>
		</view>
		
		<!-- 升级VIP弹窗 -->
		<view class="user_vip_tips" v-if="user_vip_tips">
			<view class="user_vip_back"></view>
			<view class="user_vip_content">
				<view class="user_vip_close" @click="user_vip_tips = false">
					<image src="https://ly.jukee.net/uploads/default/20230803/8d5635ef7c1504bfadbd85f0a04270cc.png" />
				</view>
				<view class="user_vip_icon">
					<image src="https://img.jukee.net/def/3902e202311271626269626.png" />
				</view>
				<view class="user_vip_title font-size32-bold">成为VIP会员</view>
				<view class="user_vip_tit font-size36-bold" style="font-size: 46rpx;">无限添加客户微信<br/>查看所有客户联系方式</view>
				<view class="user_vip_messag">更多权益请在 “我的” 会员中心查看</view>
				<view class="user_vip_btn" @click="goUrl('/pages/annex/vip_paid/index')">确定</view>
			</view>
		</view>
		
		<!-- 我的名片 -->
		<view class="user-card-popup" v-if="is_user_card == 1">
			<view class="user-card-back" @click="is_user_card = 0"></view>
			<view class="user-card-image">
				<view class="user-card-tips" style="margin: 0 0 20rpx;display: flex;align-items: center;justify-content: space-between;"><text>点击名片查看更多</text><text class="iconfont icon-guanbi" @click="is_user_card = 0"></text></view>
				<image :src="user_card" mode="widthFix" @click="userCard" />
				<view class="user-card-tips">分享名片获得每笔成交额80%</view>
				<view class="user-card-btn">
					<view class="user-card-save" @click="userCardSave">保存名片</view>
					<view class="user-card-save" @click="goUrl('/pages/extends/user_information/index')">完善名片</view>
				</view>
			</view>
		</view>
		
		<!-- 我的客户 -->
		<view class="my-card" @click="userCard">我的名片</view>
		<navigator url="/pages/users/user_demand/index" hover-class="none" class="my-customer">我的客户</navigator>
		
		<view class="back_popup flex-aj-center" @click="wechat_qrcode_img = ''" v-if="wechat_qrcode_img">
			<image :src="wechat_qrcode_img" style="width: 500rpx;border-radius: 20rpx;" mode="widthFix" @click="previewImage(wechat_qrcode_img)">
		</view>
		<authorize1 @onLoadFun="onLoadFun1" :isAuto="isAuto1" :isShowAuth="isShowAuth1" @authColse="authColse1" :isGoIndex="false"></authorize1>
	</view>
</template>
<script>
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
let app = getApp();
import { getUserInfo } from '@/api/user.js';
import { getDiy, getPageDiy, getIndexData, getAppVersion ,getUserCoupons, getLabelList, getUserServiceList, getArticleList2} from '@/api/api.js';
import { getNavigation, getAwardUserList } from '@/api/public.js';
// #ifdef MP-WEIXIN
import { getTemlIds, getCityV2 } from '@/api/api.js';
import { SUBSCRIBE_MESSAGE, TIPS_KEY } from '@/config/cache';
// #endif
import { getShare, getconfig } from '@/api/public.js';
import { goShopDetail } from '@/libs/order.js';
import { mapGetters } from 'vuex';
import { getProductslist, getProductHot, storeCategory } from '@/api/store.js';
import { initiateAssistApi } from '@/api/activity.js';
import { recommendCommunity, recommendCircle, getAttentionCircle } from '@/api/circle.js';
import { setVisit, spread, recommendCustom, userHasReward, getUserContactInformation, userCard } from '@/api/user.js';
import recommend from '@/components/recommend';
// #ifndef H5
import passwordPopup from '@/components/passwordPopup';
// #endif
// #ifdef H5
import mConfig from './component/index.js';
// #endif
import authorize from '@/components/Authorize';
// #ifdef MP || APP-PLUS
// import headerSerch from './component/headerSerch';
import homeComb from './component/homeComb';
// import customerService from './component/customerService';
// import goodList from './component/goodList';
// import liveBroadcast from './component/liveBroadcast';
// import menus from './component/menus';
// import news from './component/news';
// import topic from './component/topic';
// import presellList from './component/presellList';
// import pictureCube from './component/pictureCube'
// import richText from './component/richText';
// import seckill from './component/seckill';
// import swiperBg from './component/swiperBg';
// import tabNav from './component/tabNav';
// import titles from './component/titles';
import demand from '@/components/demand';
import service from '@/components/service';
import publishPopup from '@/components/publishPopup';
import userListPopup from "@/components/userListPopup/index.vue";
import videoListComposer from '@/components/videoList';
// #endif
import circleItem from '@/components/circle_item';
import { silenceBindingSpread, configMap, isWeixin } from '@/utils/index';
import history from '@/mixins/history';
import shareScence from '@/libs/spread';
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
// #ifdef MP
import privacyMenu from '@/components/privacyMenu.vue';
// #endif
import authorize1 from '@/components/Authorize1';
import {getNewPeopleCouponLst} from '@/api/activity.js'
import { HTTP_REQUEST_URL } from '@/config/app';
export default {
	computed: configMap({hide_mer_status:0,recommend_switch:0,beian_sn:'',share_title:'',site_name:'',hot_ranking_switch:0,navigation: {}, is_community_video_start: 0, showPrivacy: false},
	mapGetters(['isLogin','uid','keyColor'])),
	mixins: [history],
	components: {
		easyLoadimage,
		recommend,
		authorize,
		// #ifndef H5
		passwordPopup,
		// #endif
		// #ifdef H5
		...mConfig,
		// #endif
		// #ifdef MP || APP-PLUS
		// headerSerch,
		homeComb,
		// customerService,
		// goodList,
		// liveBroadcast,
		// menus,
		// news,
		// topic,
		// presellList,
		// pictureCube,
		// richText,
		// seckill,
		// swiperBg,
		// tabNav,
		// titles,
		// #endif
		demand,
		service,
		videoListComposer,
		userListPopup,
		publishPopup,
		// #ifdef MP
		privacyMenu,
		// #endif
		circleItem,
		authorize1,
	},
	data() {
		return {
			domain: HTTP_REQUEST_URL,
			couponTypeMsg:{
				10: '通用券',
				11: '品类券',
				12: '跨店券'
			},
			styleConfig: [],
			showSkeleton: true, //骨架屏显示隐藏
			isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
			privacyStatus: false,
			errorNetwork: false,
			userInfo: {},
			loading: false,
			isAuto: false, //没有授权的不会自动授权
			isShowAuth: false, //是否隐藏授权
			statusBarHeight: statusBarHeight,
			navIndex: 0,
			navTop: [],
			subscribe: false,
			followUrl: '',
			followHid: true,
			followCode: false,
			sortList: [],
			window: false,
			navH: '',
			couponList: [],
			marTop: 0,
			loadend: false,
			loadTitle: '加载更多',
			sortProduct: [],
			where: {
				pid: 0,
				page: 1,
				limit: 6
			},
			is_switch: true,
			hotPage: 1,
			hotLimit: 30,
			hotScroll: true,
			hotLoading: false,
			hotTitle: '加载更多',
			explosiveMoney: [],
			domOffsetTop: 50,
			// #ifdef MP || APP-PLUS
			isFixed: true,
			// #endif
			// #ifdef H5
			isFixed: false,
			// #endif
			isScrolled: true, // 顶部导航固定
			scrolled: false,
			goodScroll: true, //精品推荐开关
			params: {
				//精品推荐分页
				page: 1,
				limit: 10
			},
			tempArr: [], //精品推荐临时数组
			numConfig: 0,
			pageInfo: '', // 精品推荐全数据
			swiperCur: 0,
			d: '',
			h: '',
			m: '',
			s: '',
			sum_h: '',
			sortMarTop: 0,
			globalDatas: {},
			// #ifdef MP || APP-PLUS
			mpHeight: 108,
			// #endif
			// #ifndef MP || APP-PLUS
			mpHeight: 0,
			// #endif
			currSpid: '',
			_options:{},
			isIntegral: false,
			appUpdate: {},
			sortMpTop: 0,
			bgColor: '',
			bgPic: '',
			bgTabVal: '',
			windowHeight: 0,
			domHeight: 0,
			isHeaderSerch: false,
			showCoupon: false,
			couponArray: [],
			smallPage: false,
			isMenu: false,
			isScale: false,
			homeCombData: {},
			appScroll: 0,
			footerStatus: false,
			newData: {},
			activeRouter: '',
			countNum: 0,
			overflow: false,
			locationAddress: '定位',
			label_list:[],
			tabId: 0,
			tabIdIndex: 0,
			recommendCustomDataType: 1, // 1意向客户 2附近客户
			recommendCustomDataLabelId: 0,
			recommendCustomData: { // 推荐客户
				count: 0,
				list: [],
			},
			recommendDemandData: { // 推荐行业需求
				count: 0,
				list: [],
			},
			recommendCircleData: { // 行业社群
				count: 0,
				list: [],
			},
			recommendDemandServiceType: 1, // 1服务 3需求
			recommendDemandServiceData: { // 同城服务 同城需求
				count: 0,
				list: [],
			},
			recommendVideoData: { // 行业视频
				count: 0,
				list: [],
			},
			service_square_page: 1,
			service_square_loading: true,
			service_loading: true,
			recommendServiceData: { // 服务广场
				count: 0,
				list: [],
			},
			is_user_recommend_popup: false,
			userRecommendPopupList: { // 意向客户
				count: 0,
				list: [],
			},
			isPublishPopup: false,
			demandType: 1, // 合作 项目
			red_envelope_reward_popup: false,
			share: {
				title: '为您每天推送精准新客户，还可以一键群发广告。',
				imageUrl: 'https://img.jukee.net/def/27c8b202403131439281180.jpg',
				url: '',
			},
			is_demand_msg: 0, // 需求推送未读弹窗
			demand_msg: [], // 需求推送未读弹窗内容
			article_list: [],// 文章列表
			popup_user_contact: '',
			is_popup_user_contact: false,
			popup_user_contact_type: '',
			user_vip_tips: false, // 提醒用户开启VIP弹窗
			wechat_qrcode_img: '', // 微信二维码
			isAuto1: false, //没有授权的不会自动授权
			isShowAuth1: false, //是否隐藏授权
			award_user_list: [],
			is_user_card: 0,
			user_card: '',
		}
	},
	/**
	 * 用户点击右上角分享
	 */
	// #ifdef MP
	onShareAppMessage: function() {
		let that = this;
		wx.showShareMenu({
			withShareTicket: true,
			menus: ['shareAppMessage', 'shareTimeline']
		});
		return {
			title: that.share.title,
			imageUrl: that.share.imageUrl || 'https://img.jukee.net/def/5eecf202404270947461097.jpg',
			path: that.share.url || '/pages/index/index?spid=' + that.uid + '&label_id=' + that.tabId
		}
	},
	onShareTimeline: function() {
		let that = this;
		return {
			title: that.share_title,
			query: {
				spid: that.uid
			},
			imageUrl: ''
		};
	},
	// #endif
	async onLoad(options) {
		let that = this
		this._options = options;
		// #ifdef APP-PLUS
		const pages = getCurrentPages();
		const page = pages[pages.length - 1];
		const currentWebview = page.$getAppWebview();
		currentWebview.setStyle({
		  pullToRefresh: {
		    support: !that.isSupport,
		    style: plus.os.name === 'Android' ? 'circle' : 'default'
		  }
		});
		that.isSupport = !that.isSupport;
		that.appVersionConfig(); //APP版本检测
		// #endif
		// #ifdef MP
		// 小程序隐私弹窗
		if(that.showPrivacy) {
			that.$refs.privacyMenuPopup.handleDisagreeOpen()
		}
		// #endif
		that.tabId = options.label_id || that.$Cache.get('engagedIndustry') || '';
		that.$nextTick(function() {
			uni.getSystemInfo({
				success: function(res) {
					that.windowHeight = res.windowHeight;
				}
			});
		})
		that.pageLoad(options);
		that.getLabel();
		if(that.$Cache.has('userAddress')){
			let userAddress = that.$Cache.get('userAddress', true);
			that.locationAddress = userAddress.city || '定位'
		}
		// 意向客户
		// that.getRecommendUserList();
		if(that.isLogin) {
			that.openAuto1()
			// 登录判断是否有领取过需求发布奖励，没有弹窗提醒
			userHasReward({type: 'community_msg'}).then(res=>{
				if(res.data && res.data.status == 1) {
					if (res.data.msg && res.data.msg.length) {
						that.is_demand_msg = 1;
						that.demand_msg = res.data.msg;
					}
				}
			}).catch(err=>{
				console.log(err);
			})
		}
		if (options.is_refresh && options.is_refresh == 1) {
			// 推荐服务广场
			that.getRecommendService(true);
		}
		this.getAwardUserList();
	},
	created(options) {
		let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
		let curRoute = routes[routes.length - 1].route //获取当前页面路由
		this.activeRouter = '/' + curRoute
	},
	onShow() {
		let that = this
		that.getConfig();
		that.isIntegral = uni.getStorageSync('isIntegral')
		// #ifdef APP-PLUS
		if(that.appUpdate.openUpgrade == '1'){
			that.alertAppUpdate();
		}
		// #endif
		that.getNav()
		that.loadCoupon()
		// 判断登录
		if (that.isLogin) {
			that.getUserInfo();
		}
		if(that.isLogin && !that.$Cache.has('is_demand_reward')) {
			// 登录判断是否有领取过需求发布奖励，没有弹窗提醒
			userHasReward({type: 'demand_reward'}).then(res=>{
				if(res.data && res.data.status == 1) {
					that.red_envelope_reward_popup = true;
					that.$Cache.set('is_demand_reward', 1, 300);
				} else {
					that.$Cache.set('is_demand_reward', 1, 3000);
				}
			}).catch(err=>{
				console.log(err);
			})
		}
	},
	onHide() {
		uni.setStorageSync('isIntegral',false)
	},
	onReady() {

	},
	watch: {
		globalDatas(nVal, oVal) {
			// #ifdef H5
			this.ShareInfo(nVal);
			// #endif
		},
	},
	onPullDownRefresh(){
		this.overflow = true;
		this.reconnect();
	},
	methods: {
		getAwardUserList() {
			getAwardUserList({page: 1, limit: 30}).then(res=>{
				this.award_user_list = res.data;
				const awardUserListCount = res.data.length
			})
		},
		openAuto1() {
		  // #ifdef MP
			  if (uni.getPrivacySetting) {
				uni.getPrivacySetting({
				  success: res => {
					console.log("是否需要授权：", res.needAuthorization, "隐私协议的名称为：", res.privacyContractName, res)
				  },
				})
			  }
			  // 小程序隐私弹窗
			  if(app.globalData.showPrivacy) {
				return this.$refs.privacyMenuPopup.handleDisagreeOpen()
			  }
		  // #endif
		  this.isAuto1 = true;
		  this.isShowAuth1 = true
		},
		onLoadFun1(data) {
		
		},
		authColse1: function(e) {
		  this.isShowAuth1 = e
		},
		previewImage(url) {
			uni.previewImage({
				urls: [url],
				longPressActions :{
					itemList:['保存图片']
				},
			})
		},
		/**
		 * 主页详情
		 */
		getUserDetail(uid){
			if (this.isLogin === false) {
				this.isAuto = true;
				this.isShowAuth = true
			} else {
				console.log('getUserDetail', uid)
			}
		},
		loadCoupon(){
			if(!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')){
				getNewPeopleCouponLst().then(res => {
					this.couponArray = res.data;
					setTimeout(() => {
						this.showCoupon = this.couponArray.length > 0;
						uni.setStorageSync('show_coupon', '1')
					}, 1500);
				})
			}
		},	
		pageLoad(options){
			let that = this;
			if (options.spid) {
				that.currSpid = options.spid;
				app.globalData.spid = options.spid;
			}
			// #ifdef APP-PLUS
			try {
				let val = uni.getStorageSync('privacyStatus') || true;
				if (!val) {
					this.privacyStatus = true;
				}
			} catch (e) {}
			this.snycNetWork();
			// #endif
			// #ifdef MP
			if (options.scene) {
				let value = that.$util.getUrlParams(decodeURIComponent(options.scene));
				if (value.id) options.id = value.id;
				//记录推广人uid
				if (value.spid) {
					that.currSpid = value.spid;
					app.globalData.spid = value.spid;
				}
			}
			// #endif
			shareScence(that.currSpid, that.isLogin);
			this.isLogin && silenceBindingSpread();
			this.getIndexConfig()
			Promise.all([
				this.diyData(0),
			]);
			if (this.isLogin) {
				// #ifdef MP
				this.getHistory();
				// #endif
			}
		},
		/**
		 * 获取定位
		 */
		getLocationAddress() {
			let that = this;
			app.getPositioning(false).then(res=>{
				that.locationAddress = res.city;
				that.$Cache.set('userAddress', res);
			}).catch(err=>{
				console.log('定位失败', err);
			})
		},
		/**
		 * 地址发生变化重新请求同城数据
		 */
		changeAddress() {
			let that = this;
			that.$set(that, 'recommendDemandServiceData', {count: 0,list: []})
			// 判断当前是否是同城用户
			if(that.recommendCustomDataType == 2) {
				that.getRecommendCustom(that.recommendCustomDataType)
			}
			// 重新请求同城行业
			that.getRecommendDemandService();
			if(that.$Cache.has('userAddress')){
				let userAddress = that.$Cache.get('userAddress', true);
				that.locationAddress = userAddress.city || userAddress.province || '定位'
			}
		},
		/**
		 * 获取行业列表
		 */
		getLabel() {
			let that = this,
				customerIndustry = this.$Cache.get('customerIndustry'),
				engagedIndustry = this.$Cache.get('engagedIndustry'),
				is_sort = true,
				label_id =  this.tabId;
			getLabelList({customerIndustry, engagedIndustry, is_sort, label_id: that.tabId, is_home: 1}).then(res=>{
				that.label_list = res.data.list;
				if (!that.tabId) {
					that.tabId = that.label_list[0].label_id;
					that.share.title = that.label_list[0].share_desc || '为您每天推送精准新客户，还可以一键群发广告。';
					that.share.imageUrl = that.label_list[0].image || 'https://img.jukee.net/def/27c8b202403131439281180.jpg';
					that.share.url = '';
				} else if(res.data.key) {
					that.tabIdIndex = res.data.key;
					that.share.title = that.label_list[res.data.key].share_desc || '为您每天推送精准新客户，还可以一键群发广告。';
					that.share.imageUrl = that.label_list[res.data.key].image || 'https://img.jukee.net/def/27c8b202403131439281180.jpg';
					that.share.url = '';
				}
				// 推荐用户
				that.getRecommendCustom(that.recommendCustomDataType);
				
				// 推荐行业需求
				that.getRecommendDemand();
				// 推荐行业社群
				that.getRecommendCircle();
				// 推荐同城服务需求
				that.getRecommendDemandService();
				// 推荐行业视频
				that.getRecommendVideo();
				// 推荐服务广场
				that.getRecommendService(true);
				// 文章列表
				that.getArticleList();
			}).catch(err=>{
				console.log('err', err);
			})
		},
		clickRecommendUsers(type){
			let that = this;
			if(type == 2 && !that.$Cache.has('userAddress')){
				app.getPositioning(false).then(res=>{
					that.$Cache.set('userAddress', res);
					that.recommendCustomDataType = type
					that.getRecommendCustom(type)
				}).catch(err=>{
					console.log('定位失败', err);
				})
			}else{
				that.recommendCustomDataType = type
				that.getRecommendCustom(type)
			}
		},
		clickDemandType(type) {
			let that = this;
			that.demandType = type;
			that.recommendDemandData.list = [];
			that.recommendDemandData.count = 0;
			that.getRecommendDemand();
		},
		/**
		 * 推荐客户
		 */
		getRecommendCustom(type){
			let that = this;
			let userAddress = {},
			tabId = that.tabId;
			if(that.$Cache.has('userAddress')){
				userAddress = that.$Cache.get('userAddress', true);
			}
			recommendCustom({...userAddress, type, tabId, is_not_avatar: 1, is_promotion: 1, is_weixin: 1, page: 1, limit: 30}).then(res=>{
				if(res.status == 200) {
					if(res.data.count) {
						// that.recommendCustomData.list = that.$util.dataPagination(res.data.list, 4);
						that.recommendCustomData.list = res.data.list;
						that.recommendCustomData.count = res.data.count;
					} else {
						that.recommendCustomData = res.data;
					}
				}
			}).catch(err=>{
				console.log('getRecommendCustomerr', err);
			})
			
		},
		// 意向客户
		getRecommendUserList() {
			let that = this;
			let customerIndustry = this.$Cache.get('customerIndustry');
			recommendCustom({customerIndustry, type: 1, page: 1, limit: 30, is_demand: 1}).then(res=>{
				that.is_user_recommend_popup = res.data.count ? true : false;
				that.userRecommendPopupList = res.data;
			}).catch(err=>{
			})
		},
		// 关闭意向客户弹窗
		closeUserRecommendPopup() {
			this.is_user_recommend_popup = false;
		},
		// 推荐行业需求
		getRecommendDemand() {
			let that = this;
			let data = {
				is_type: 3,
				label_id: that.tabId, 
				page: 1, 
				limit: 21,
				type: that.demandType == 2 ? 10 : ''
			}
			recommendCommunity(data).then(res=>{
				if(res.status == 200) {
					if(res.data.count) {
						that.recommendDemandData.list = that.$util.dataPagination(res.data.list, 3);
						that.recommendDemandData.count = res.data.count;
						that.userRecommendPopupList = res.data.list
						that.is_user_recommend_popup = res.data.count ? true : false;
					} else {
						that.recommendDemandData = res.data;
					}
				}
			}).catch(err=>{
				console.log('getRecommendCustomerr', err);
			})
		},
		//  推荐社群
		getRecommendCircle()
		{
			let that = this;
			let data = {
				label_id: that.tabId,
				is_home_promo: 1,
				page: 1, 
				limit: 20,
			}
			recommendCircle(data).then(res=>{
				if(res.data.count) {
					that.recommendCircleData.list = that.$util.dataPagination(res.data.list, 2);
					that.recommendCircleData.count = res.data.count;
				} else {
					that.recommendCircleData = res.data;
				}
			}).catch(err=>{
				console.log('getRecommendCircle', err);
			})
		},
		clickRecommendDemandService(type) {
			let that = this;
			that.recommendDemandServiceType = type;
			that.getRecommendDemandService();
		},
		// 推荐同城服务需求
		getRecommendDemandService()
		{
			let that = this;
			let userAddress = that.$Cache.get('userAddress', true);
			let data = {
				is_type: that.recommendDemandServiceType,
				district: userAddress.district,
				label_id: that.tabId, 
				page: 1, 
				limit: 30,
			}
			if(that.recommendDemandServiceType == 1) {
				// 同城服务商
				let address = that.$Cache.get('userAddress', true)
				data.lat = address.lat || '';
				data.lng = address.lng || '';
				getUserServiceList(data).then(res=>{
					if(res.status == 200) {
						if(res.data.count) {
							that.recommendDemandServiceData.list = that.$util.dataPagination(res.data.list, 3);
							that.recommendDemandServiceData.count = res.data.count;
						} else {
							that.recommendDemandServiceData = res.data;
						}
					}
				})
			} else {
				recommendCommunity(data).then(res=>{
					if(res.status == 200) {
						if(res.data.count) {
							that.recommendDemandServiceData.list = that.$util.dataPagination(res.data.list, 2);
							that.recommendDemandServiceData.count = res.data.count;
						} else {
							that.recommendDemandServiceData = res.data;
						}
					}
				}).catch(err=>{
					console.log('getRecommendDemandService', err);
				})
			}
		},
		// 推荐行业视频
		getRecommendVideo()
		{
			let that = this;
			let data = {
				is_type: 2,
				label_id: that.tabId, 
				page: 1, 
				limit: 9,
			}
			recommendCommunity(data).then(res=>{
				if(res.status == 200) {
					if(res.data.count) {
						that.recommendVideoData.list = that.$util.dataPagination(res.data.list, 3);
						that.recommendVideoData.count = res.data.count;
					} else {
						that.recommendVideoData = res.data;
					}
				}
			}).catch(err=>{
				console.log('getRecommendVideo', err);
			})
		},
		// 服务广场
		getRecommendService(is_reset = false)
		{
			let that = this;
			if(is_reset) {
				that.service_square_page = 1;
				that.service_square_loading = true;
				that.$set(that.recommendServiceData, 'list', [])
				that.$set(that.recommendServiceData, 'count', 0)
			}
			if(!that.service_loading) return false;
			if(!that.service_square_loading) return false;
			let is_promotion = that.tabId == -1 ? 1 : 0;
			let is_industry_top = that.tabId == -1 ? 0 : 1;
			let data = {
				is_type: 1,
				label_id: that.tabId, 
				page: that.service_square_page, 
				limit: 10,
				is_promotion: is_promotion,
				is_industry_top: is_industry_top,
			}
			that.service_loading = false;
			recommendCommunity(data).then(res=>{
				that.service_loading = true;
				let list = that.recommendServiceData.list.concat(res.data.list);
				that.$set(that.recommendServiceData, 'list', list)
				that.$set(that.recommendServiceData, 'count', res.data.count)
				if(res.data.list.length >= 10) {
					that.service_square_page += 1
				} else {
					that.service_square_loading = false;
				}
			}).catch(err=>{
				that.service_loading = false;
			})
		},
		// 行业快讯
		getArticleList() {
			let that = this;
			let data = {
				label_id: this.tabId, 
				page: 1, 
				limit: 5
			}
			getArticleList2(data).then(res=>{
				that.$set(that, 'article_list', res.data.list);
			})
		},
		closeShare(){
			uni.setStorageSync('isIntegral',false);
			this.isIntegral = uni.getStorageSync('isIntegral');
		},
		bindHeighta(data) {
			// #ifdef APP-PLUS
			this.sortMpTop = data.top + data.height;
			// #endif
		},
		// 重新链接
		reconnect() {
			uni.getNetworkType({
				success: res => {
					this.errorNetwork = res.networkType === 'none';
					if(!this.errorNetwork){
						this.pageLoad(this._options);
					}else{
						uni.stopPullDownRefresh();
						that.overflow = false;
					}
				}
			});
		},
		getNav(){
			getNavigation().then(res => {
				this.newData = res.data
				if (this.newData.status && this.newData.status.status) {
					uni.hideTabBar()
				} else {
					uni.showTabBar()
				}
			})
		},
		// #ifdef APP-PLUS
		snycNetWork() {
			uni.getNetworkType({
				success: res => {
					this.errorNetwork = res.networkType === 'none';
				}
			});
		},
		// 同意隐私协议
		confirmApp() {
			uni.setStorageSync('privacyStatus', true);
			this.privacyStatus = false;
		},
		// 关闭 Model
		closeModel() {
			this.privacyStatus = false;
		},
		// #endif
		// 对象转数组
		objToArr(data) {
			let obj = Object.keys(data).sort();
			let m = obj.map(key => data[key]);
			return m;
		},
		goRouter(item, index) {
			if (index == 0) {
				this.changeDiy({label_id: "-1", tabIdIndex: 0});
				return false;
			}
			if(index == 2) {
				this.isPublishPopup = true;
			} else if(index == 3) {
				uni.navigateTo({
					url: item.link
				})
			} else {
				var pages = getCurrentPages();
				var page = (pages[pages.length - 1]).$page.fullPath;
				if (item.link == page) return
				uni.switchTab({
					url: item.link,
					fail(err) {
						uni.redirectTo({
							url: item.link
						})
					}
				})
			}
		},
		diyData(id) {
			let that = this;
			let data = {
				id: id
			}
			that.styleConfig = []
			getDiy(data).then(res => {
				setTimeout(() => {
					that.isNodes++;
				}, 0);
				that.errorNetwork = false
				uni.setNavigationBarTitle({
					title: res.data.title
				});
				let data = res.data;
				if (data.is_bg_color) {
					that.bgColor = data.color_picker
				}
				if (data.is_bg_pic) {
					that.bgPic = data.bg_pic
					that.bgTabVal = data.bg_tab_val
				}
				that.styleConfig = that.objToArr(res.data.value);
				that.styleConfig.forEach((item, index, arr) => {
					if (item.name == 'headerSerch' || item.name == 'homeComb') {
						that.isHeaderSerch = true
						if(item.name == 'homeComb'){
							that.homeCombData = item
							that.smallPage = true;
						}
					}
					if (item.name == 'pageFoot') {
						if (item.status && item.status.status) {
							this.newData = item
							setTimeout((e) => {
								that.$set(that, 'footerStatus', true);
							}, 50)
						}
						uni.setStorageSync('FOOTER_BAR', item.status && item.status.status ? true : false)
						item.menuList.map((path, index) => {
							if (path.link === '/pages/order_addcart/order_addcart') {
								uni.setStorageSync('FOOTER_ADDCART', index)
							}
						})
						arr.splice(index, 1);
					}
					if(item.name == 'menus'){
						that.isMenu = true;
					}
					uni.pageScrollTo({
						scrollTop: 0,
					})
					uni.stopPullDownRefresh();
					that.overflow = false;
				});
			});
		},
		/**
		 * 切换客户类型
		 * @param {Object} id
		 */
		changeDiy(data) {
			this.tabId = data.label_id;
			this.tabIdIndex = data.tabIdIndex;
			this.share.title = this.label_list[data.tabIdIndex].share_desc || '为您每天推送精准新客户，还可以一键群发广告。';
			this.share.imageUrl = this.label_list[data.tabIdIndex].image || 'https://img.jukee.net/def/27c8b202403131439281180.jpgc';
			this.share.url = '';
			// 推荐用户
			this.getRecommendCustom(this.recommendCustomDataType);
			// 推荐行业需求
			this.getRecommendDemand();
			// 推荐行业社群
			this.getRecommendCircle();
			// 推荐同城服务需求
			this.getRecommendDemandService();
			// 推荐行业视频
			this.getRecommendVideo();
			// 推荐服务广场
			this.getRecommendService(true);
			// 文章列表
			this.getArticleList();
		},
		// 微信登录回调
		onLoadFun: function(e) {
			this.isShowAuth = false;
		},
		// #ifdef APP-PLUS
		appVersionConfig() {
			var that = this;
			//app升级
			// 获取本地应用资源版本号
			getAppVersion().then(res => {
				that.$set(that.appUpdate, 'androidAddress', res.data.androidAddress);
				that.$set(that.appUpdate, 'appVersion', res.data.appVersion);
				that.$set(that.appUpdate, 'iosAddress', res.data.iosAddress);
				that.$set(that.appUpdate, 'openUpgrade', res.data.openUpgrade);
				plus.runtime.getProperty(plus.runtime.appid, function(inf) {
					let nowVersion = (inf.version).split('.').join('');
					let appVersion = (res.data.appVersion).split('.').join('');
					that.$set(that.appUpdate, 'alert', appVersion > nowVersion);
					that.alertAppUpdate();
				});
			})
		},
		alertAppUpdate(){
			if(this.appUpdate.alert) {
				uni.getSystemInfo({
					success: (res) => {
						uni.showModal({
							title: '更新提示',
							content: '发现新版本，是否前去下载?',
							showCancel: this.appUpdate.openUpgrade != '1',
							cancelColor: '#eeeeee',
							confirmColor: '#FF0000',
							success:(response)=> {
								if (response.confirm) {
									switch (res.platform) {
										case "android":
											plus.runtime.openURL(this
												.appUpdate
												.androidAddress);
											break;
										case "ios":
											plus.runtime.openURL(encodeURI(
												this.appUpdate
												.iosAddress));
											break;
									}
								}
							}
						});
					}
				})
			}
		},
		// #endif
		getConfig() {
			// 获取配置
			getconfig()
				.then(res => {
					let self = this;
					this.globalDatas = res.data;
					uni.$emit('configData', res.data);
				})
				.catch(err => {});
		},
		// 分类页更多
		bindMore() {
			try {
				uni.setStorageSync('storeIndex', this.navTop[this.navIndex].pid);
				uni.switchTab({
					url: '/pages/goods_cate/goods_cate'
				});
			} catch (e) {}
		},
		goDetails(item) {
			goShopDetail(item, this.uid).then(res => {
				if (this.isLogin) {
					initiateAssistApi(item.activity_id)
						.then(res => {
							let id = res.data.product_assist_set_id;
							uni.hideLoading();
							uni.navigateTo({
								url: '/pages/activity/assist_detail/index?id=' + id
							});
						})
						.catch(err => {
							uni.showToast({
								title: err,
								icon: 'none'
							});
						});
				} else {
					this.isAuto = true;
					this.isShowAuth = true
				}
			});
		},
		/**
		 * 获取个人用户信息
		 */
		getUserInfo: function() {
			let that = this;
			getUserInfo().then(res => {
				that.userInfo = res.data;
			});
		},
		// 记录会员访问
		setVisit() {
			setVisit({
				url: '/pages/index/index'
			}).then(res => {
				console.log(res);
			});
		},
		// 首页数据
		getIndexConfig: function() {
			let that = this;
			getIndexData().then(res => {
				res.data.category.unshift({
					cate_name: '首页'
				});
				that.$set(that, 'navTop', res.data.category);
				// #ifdef H5
				that.subscribe = res.data.subscribe;
				// #endif
				// 小程序判断用户是否授权；
				// #ifdef MP
				uni.getSetting({
					success(res) {
						if (!res.authSetting['scope.userInfo']) {
							that.window = that.couponList.length ? true : false;
						} else {
							that.window = false;
						}
					}
				});
				// #endif
				// #ifndef MP
				if (that.isLogin) {
					that.window = false;
				} else {
					that.window = that.couponList.length ? true : false;
				}
				// #endif
				that.reloadData();
			});
		},
		reloadData() {
			setTimeout(() => {
				this.showSkeleton = false
			}, 500)
		},
		// 授权关闭
		authColse: function(e) {
			this.isShowAuth = e;
		},
		// 首发新品详情
		goDetail(item) {
			if (item.activity && item.activity.type === '2' && !this.isLogin) {
				// #ifdef H5
				uni.showModal({
					title: '提示',
					content: '您未登录，请登录！',
					success: function(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/users/login/index'
							});
						} else if (res.cancel) {
						}
					}
				});
				// #endif
				// #ifdef MP
				this.$set(this, 'isAuto', true);
				this.$set(this, 'isShowAuth', true);
				// #endif
				return;
			} else {
				goShopDetail(item, this.uid).then(res => {
					uni.navigateTo({
						url: `/pages/goods_details/index?id=${item.id}`
					});
				});
			}
		},
		//#ifdef H5
		ShareInfo(datas) {
			let data = this.storeInfo;
			let href = location.href;
			if (this.$wechat.isWeixin()) {
				if (this.isLogin) {
					href = href.indexOf('?') === -1 ? href + '?spid=' + this.uid : href + '&spid=' + this.uid;
				} else {
					href = href;
				}
				let configAppMessage = {
					desc: datas.share_info,
					title: datas.share_title,
					link: href,
					imgUrl: datas.share_pic
				};
				this.$wechat
					.wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage', 'onMenuShareTimeline'], configAppMessage)
					.then(res => {
						console.log(res, '=============================>>WXAPI');
					})
					.catch(err => {
						console.log(err);
					});
			}
		},
		//#endif
		goUrl(url){
			if(['/pages/goods_cate/goods_cate','/pages/order_addcart/order_addcart','/pages/user/index','/pages/plant_grass/index', '/pages/goods_cate/goods_cate?activceCate=1', '/pages/goods_cate/goods_cate?is_label=2'].indexOf(url) == -1){
				uni.navigateTo({
					url:url
				})
			}else{
				uni.switchTab({
					url:url
				})
			}
		},
		getCircleInfo(circle_id) {
			let that = this;
			if(!that.isLogin) return that.$util.Tips({title:'请先登录'}, {tab: 1, url: '/pages/user/index'})
			getAttentionCircle(circle_id).then(res=>{
				if(res.status == 200 && res.data.pay_type){
					return that.$util.Tips('/pages/extends/circle_create/circle_info?id='+circle_id)
					// 如果
					return false;
				}
				return that.$util.Tips('/pages/extends/circle_create/circle_pay?id='+circle_id);
			})
		},
		closePublishPopup() {
			this.isPublishPopup = false;
		},
		clickRedEnvelopeReward() {
			if(this.isLogin) {
				this.red_envelope_reward_popup = false;
				this.$util.Tips('/pages/plantGrass/plant_release/index?type=3')
			} else {
				this.$util.Tips({title:'请先登录'}, {tab: 1, url: '/pages/user/index'})
			}
			
		},
		hasBlockLine(index){
			this.$set(this.recommendServiceData.list[index], 'is_line', false);
		},
		hasNoneLine(index){
			console.log(666, index)
			this.$set(this.recommendServiceData.list[index], 'is_line', true);
		},
		setCommunityShare(data) {
			this.share.title = data.content;
			this.share.imageUrl = data.image[0]
			this.share.url = '/pages/plantGrass/plant_user/index?id='+data.uid+'&searchType=1&community_id='+data.community_id
		},
		/**
		 * 查看会员联系方式
		 * @param {Object} uid
		 * @param {Object} contact_information
		 */
		getUserContactInformations(data, contact_information, is_weixin) {
			if(!this.isLogin) return this.$util.Tips({title:'请先登录'}, {tab: 1, url: '/pages/user/index'});
			let that = this;
			let uid = data.uid;
			if (!uid) return this.$util.Tips({title: '缺少请求用户'});
			getUserContactInformation({uid, contact_information, is_weixin}).then(res=>{
				if(contact_information == 'phone' && checkPhone(res.message)) {
					return uni.makePhoneCall({
						phoneNumber: res.message // 替换为你想拨打的电话号码
					  }).then(() => {
						console.log('拨打电话成功')
					  }).catch((error) => {
						console.log('拨打电话失败', error)
					  })
				} else {
					if (res.data && res.data.is_img == 1) {
						that.wechat_qrcode_img = res.data.data;
					} else {
						if (res.message) {
							that.popup_user_contact = res.message || '暂未设置该联系方式'
							that.popup_user_contact_type = contact_information;
							that.is_popup_user_contact = true;
						} else {
							uni.showModal({
								title: '温馨提示',
								content: '等待对方验证',
								showCancel: false,
							})
						}
					}
				}
			}).catch(err=>{
				if(err == '次数不足') {
					that.user_vip_tips = true;
					// that.pay_close = true;
				} else {
					that.$util.Tips({title: err});
				}
			})
		},
		copyUserContact() {
			let that = this;
			that.is_popup_user_contact = false;
			if(this.popup_user_contact && this.popup_user_contact!='暂未设置该联系方式') {
				uni.setClipboardData({
				  data: that.popup_user_contact,
				  success: function () {
					return that.$util.Tips({title:'复制成功'});
				  }
				})
			}else{
				return this.$util.Tips({title:'复制失败'});
			}
		},
		userCard() {
			uni.showLoading({
				title: '加载中'
			});
			userCard().then(res=>{
				this.user_card = res.message;
				this.is_user_card = 1;
				uni.hideLoading()
			}).catch(err=>{
				this.$util.Tips({title: err});
				uni.hideLoading()
			})
		},
		userCardSave() {
			if (this.user_card) {
				let that = this;
				let url = this.user_card;
				// #ifdef MP
				uni.getSetting({
					success(res) {
						if (!res.authSetting['scope.writePhotosAlbum']) {
							uni.authorize({
								scope: 'scope.writePhotosAlbum',
								success() {
									uni.downloadFile({
									    url: url, // 替换为实际的图片网络地址
									    success: function (downloadRes) {
									        if (downloadRes.statusCode === 200) {
									            const localFilePath = downloadRes.tempFilePath;
									            uni.saveImageToPhotosAlbum({
									            	filePath: localFilePath,
									            	success: function(res) {
									            		that.$util.Tips({
									            			title: '保存成功',
									            			icon: 'success'
									            		});
									            	},
									            	fail: function(res) {
									            		that.$util.Tips({
									            			title: '保存失败'
									            		});
									            	}
									            });
									        }
									    },
									    fail: function (err) {
											that.$util.Tips({
												title: '下载图片失败'
											});
									    }
									});
								}
							});
						} else {
							uni.downloadFile({
							    url: url, // 替换为实际的图片网络地址
							    success: function (downloadRes) {
							        if (downloadRes.statusCode === 200) {
							            const localFilePath = downloadRes.tempFilePath;
							            uni.saveImageToPhotosAlbum({
							            	filePath: localFilePath,
							            	success: function(res) {
							            		that.$util.Tips({
							            			title: '保存成功',
							            			icon: 'success'
							            		});
							            	},
							            	fail: function(res) {
							            		that.$util.Tips({
							            			title: '保存失败'
							            		});
							            	}
							            });
							        }
							    },
							    fail: function (err) {
									that.$util.Tips({
										title: '下载图片失败'
									});
							    }
							});
						}
					}
				});
				// #endif
			}
		}
	},
	mounted() {
		let query = uni.createSelectorQuery().in(this);
		query.select("#home").boundingClientRect();
		query.exec(res => {
			this.domHeight = res[0].height;
		})
	},
	// 滚动到底部
	onReachBottom() {
		this.getRecommendService();
	},
	// 滚动监听
	/* onPageScroll(e) {
		if (this.isHeaderSerch) {
			let isScroll = false
			this.appScroll = e.scrollTop
			// #ifdef APP-PLUS
			// isScroll = e.scrollTop > 50
			// #endif
			// #ifdef MP || H5
			// isScroll = e.scrollTop > 50 && this.windowHeight - this.domHeight >= 50
			// #endif
			isScroll = e.scrollTop > 50
			this.isScrolled = isScroll;
		} else {
			this.isScrolled = false
		}
		// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
		uni.$emit('scroll');
	} */
};
</script>
<style>

</style>
<style lang="scss" scoped>
.bnt1{
	color: red;
}
.overflow-mask{
	position: fixed;
	top: 0;
	left: 0;
	z-index: 32;
	width: 100%;
	height: 100vh;
	background: transparent;
	transition: all .5s;
}
page {
	display: flex;
	flex-direction: column;
}
.home-comb {
	position: sticky;
	top: 0;
	z-index: 5;
}
::v-deep .home-comb .my-main{
	left: 0;
	// position: fixed;
	top: 0;
	width: 100%;
	z-index: 30;
}
.main {
	padding: 0 20rpx;
}
.colum0{
	white-space: nowrap; 
	display: flex;
}
.ysize {
	background-size: 100%;
}
.fullsize {
	background-size: 100% 100%;
}
.repeat {
	background-repeat: repeat;
}
.noRepeat {
	background-repeat: no-repeat;
}
.privacy-wrapper {
	z-index: 999;
	position: fixed;
	left: 0;
	top: 0;
	bottom: 0;
	right: 0;
	width: 100%;
	height: 100%;
	background: #7f7f7f;
	.privacy-box {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		width: 560rpx;
		padding: 50rpx 45rpx 0;
		background: #fff;
		border-radius: 20rpx;
		.title {
			text-align: center;
			font-size: 32rpx;
			text-align: center;
			color: #333;
			font-weight: 700;
		}
		.content {
			margin-top: 20rpx;
			line-height: 1.5;
			font-size: 26rpx;
			color: #666;
			navigator {
				display: inline-block;
				color: #e93323;
			}
		}
		.btn-box {
			margin-top: 40rpx;
			text-align: center;
			font-size: 30rpx;
			.btn-item {
				height: 82rpx;
				line-height: 82rpx;
				background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
				color: #fff;
				border-radius: 41rpx;
			}
			.btn {
				padding: 30rpx 0;
			}
		}
	}
}
.coupon_popups{
	z-index: 999;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	text-align: center;
	.bg{
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0,0,0,.5);
	}
	.con{
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		width: 680rpx;
		height:900rpx;
		background-size: 100% 700rpx;
		background-repeat: no-repeat;
		scroll-view{
			width: 610rpx;
			height: 306rpx;
			padding-top: 20rpx;
			margin: 300rpx auto 0;
		}
		.item{
			display: flex;
			align-items: center;
			width: 100%;
			height: 164rpx;
			background-image: url('');
			background-repeat: no-repeat;
			background-size: 100% 100%;
			margin-bottom: 20rpx;
			border-radius: 20rpx;
			position: relative;
			.left{
				width: 160rpx;
				text-align: center;
				&::after{
					content: "";
					display: block;
					height: 110rpx;
					border-right: 1px dashed #E6E6E6;
					position: absolute;
					left: 178rpx;
					top: 25rpx;
				}
				.price{
					color: #E93323;
					font-size: 26rpx;
					font-weight: bold;
					text{
						font-size: 46rpx;
					}
				}
				.max_price{
					color: #999999;
					font-size: 18rpx;
					margin-top: 8rpx;
				}
			}
			.right{
				width: 440rpx;
				padding: 0 20rpx;
				.title{
					color: #333333;
					font-size: 26rpx;
				}
				.time{
					color: #999999;
					font-size: 22rpx;
					margin-top: 20rpx;
				}
				.bnt1{
					.titleSize{
						font-weight: 700;
						font-size: 33rpx;
					}
					.titleColor{
						margin-top: 20rpx;
						color: #999999;
					}
				}
				.coupon_type{
					position: absolute;
					color: #fff;
					font-size: 15rpx;
					width: 30rpx;
					text-align: center;
					height: auto;
					background: #E93323;
					top: 0;
					right: 20rpx;
					line-height: 26rpx;
					padding: 5rpx 0 15rpx;
					&::after{
						content: "";
						width: 0;
						height: 0;
						border-left: 14rpx solid transparent;
						border-right: 14rpx solid transparent;
						border-bottom: 14rpx solid #fff;
						position: absolute;
						bottom: -4rpx;
						left: 2rpx;
					}
				}
			}
		}
		.text{
			width: 600rpx;
			margin: 30rpx auto 0;
			font-size: 20rpx;
			color: #ffffff;
		}
		.icon-guanbi3{
			color: #ffffff;
			font-size: 70rpx;
			position: absolute;
			bottom: -80rpx;
			left: 320rpx;
		}
	}
}
.item_tags{
	margin-top: 8rpx;
	display: flex;
}
.item_tags .tags_item {
	display: inline-block;
	font-size: 20rpx;
	text-align: center;
	border-radius: 5rpx;
	padding: 0 4rpx;
	line-height: 28rpx;
	margin-right: 8rpx;
}
.item_tags .tags_item.ticket{
	color: var(--view-theme);
	border: 1px solid var(--view-theme);
}
.item_tags .tags_item.delivery{
	color: #FF9000;
	border: 1px solid #FF9000;
}
.copyRight{
	margin: 60rpx auto 20rpx;
	max-width: 690rpx;
	font-size: 20rpx;
	color: #707070;
	text-decoration: none;
}
.share-box {
	z-index: 31;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	image {
		width: 100%;
		height: 100%;
	}
}
.error-network {
	position: fixed;
	left: 0;
	top: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	height: 100%;
	padding-top: 40rpx;
	background: #fff;
	padding-top: 30%;
	image {
		width: 414rpx;
		height: 336rpx;
	}
	.title {
		position: relative;
		top: -40rpx;
		font-size: 32rpx;
		color: #666;
	}
	.con {
		font-size: 24rpx;
		color: #999;
		.label {
			margin-bottom: 20rpx;
		}
		.item {
			margin-bottom: 20rpx;
		}
	}
	.btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 508rpx;
		height: 86rpx;
		margin-top: 100rpx;
		border: 1px solid #d74432;
		color: #e93323;
		font-size: 30rpx;
		border-radius: 120rpx;
	}
}
.area-row {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: block;
	width: 100%;
	text-align: center;
}
.page-index {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	.page_content {
		/* #ifdef MP || APP-PLUS */
		padding-top: 270rpx;
		/* #endif */
		.page_bg{
			background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
		}
		.nav {
			padding: 0 0rpx 30rpx;
			flex-wrap: wrap;
			/* #ifdef MP */
			margin-top: 0;
			/* #endif */
			/* #ifdef H5 */
			margin-top: 0;
			/* #endif */
			.item {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				width: 20%;
				margin-top: 30rpx;
				image {
					width: 82rpx;
					height: 82rpx;
				}
			}
		}
		.index-product-wrapper {
			.nav-bd {
				display: flex;
				align-items: center;
				.item {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					width: 25%;
					.txt {
						font-size: 32rpx;
						color: #282828;
					}
					.label {
						display: flex;
						align-items: center;
						justify-content: center;
						width: 124rpx;
						height: 32rpx;
						margin-top: 5rpx;
						font-size: 24rpx;
						color: #999;
					}
					&.active {
						color: $theme-color;
						.label {
							background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
							border-radius: 16rpx;
							color: #fff;
						}
					}
				}
			}
			.list-box {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				.item {
					width: 345rpx;
					margin-bottom: 20rpx;
					background-color: #fff;
					border-radius: 10px;
					overflow: hidden;
					image {
						width: 100%;
						height: 345rpx;
					}
					.text-info {
						padding: 10rpx 20rpx 15rpx;
						.title {
							color: #222222;
						}
						.old-price {
							margin-top: 8rpx;
							font-size: 26rpx;
							color: #aaaaaa;
							text-decoration: line-through;
							text {
								margin-right: 2px;
								font-size: 20rpx;
							}
						}
						.price {
							display: flex;
							align-items: flex-end;
							color: $theme-color;
							font-size: 34rpx;
							font-weight: 800;
							text {
								padding-bottom: 4rpx;
								font-size: 24rpx;
								font-weight: normal;
							}
							.txt {
								display: flex;
								align-items: center;
								justify-content: center;
								width: 28rpx;
								height: 28rpx;
								margin-left: 15rpx;
								margin-bottom: 10rpx;
								border: 1px solid $theme-color;
								border-radius: 4rpx;
								font-size: 22rpx;
								font-weight: normal;
							}
						}
					}
				}
				&.on {
					display: flex;
				}
			}
		}
	}
}
.productList {
	background-color: #f1f1f1;
	min-height: 70vh;
	.sort {
		width: 710rpx;
		max-height: 380rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 16rpx;
		padding: 8rpx 0rpx 30rpx;
		flex-wrap: wrap;
		margin: 25rpx auto 0 auto;
		.item {
			width: 20%;
			margin-top: 30rpx;
			text-align: center;
			.pictrues {
				width: 90rpx;
				height: 90rpx;
				background: rgba(248, 248, 248, 1);
				border-radius: 50%;
				margin: 0 auto;
			}
			.easy-loadimage {
				width: 90rpx;
				height: 90rpx;
				display: inline-block;
			}
			.text {
				color: #272727;
				font-size: 24rpx;
				margin-top: 10rpx;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
		}
	}
}
.productList .list {
	padding: 0 20rpx;
}
.productList .list.on {
	background-color: #fff;
	border-top: 1px solid #f6f6f6;
}
.productList .list .item {
	width: 345rpx;
	margin-top: 20rpx;
	background-color: #fff;
	border-radius: 10rpx;
	.name{
		display: flex;
		align-items: center;
	}
}
.productList .list .item.on {
	width: 100%;
	display: flex;
	border-bottom: 1px solid #f6f6f6;
	padding: 30rpx 0;
	margin: 0;
}
.productList .list .item .pictrue {
	position: relative;
	width: 100%;
	height: 345rpx;
}
.productList .list .item .pictrue.on {
	width: 180rpx;
	height: 180rpx;
}
::v-deep .productList .list .item .pictrue image,
::v-deep .productList .list .item .pictrue uni-image,
::v-deep .productList .list .item .pictrue .easy-loadimage{
	width: 100%;
	height: 100%;
	border-radius: 10rpx 10rpx 0 0;
}
::v-deep .productList .list .item .pictrue uni-image.origin-img{
	border-radius: 10rpx 10rpx 0 0;
}
.productList .list .item .pictrue image.on {
	border-radius: 6rpx;
}
.productList .list .item .text {
	padding: 14rpx 17rpx 26rpx 17rpx;
	font-size: 28rpx;
	color: #212121;
}
.productList .list .item .text.on {
	width: 508rpx;
	padding: 0 0 0 22rpx;
}
.productList .list .item .text .money {
	font-size: 26rpx;
	font-weight: bold;
	margin-top: 8rpx;
}
.productList .list .item .text .coupon {
	background: rgba(255, 248, 247, 1);
	border: 1px solid rgba(233, 51, 35, 1);
	border-radius: 4rpx;
	font-size: 20rpx;
	margin-left: 18rpx;
	padding: 1rpx 4rpx;
}
.productList .list .item .text .money.on {
	margin-top: 50rpx;
}
.productList .list .item .text .money .num {
	font-size: 34rpx;
}
.pictrue {
	position: relative;
	
	.border-picture {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		border-radius: 10rpx 10rpx 0 0;
		background: center/cover no-repeat;
	}
}
.cate_pictrue, ::v-deep .cate_pictrue image, ::v-deep .cate_pictrue .easy-loadimage, ::v-deep .cate_pictrue uni-image{
	width: 82rpx;
	height: 82rpx;
	margin: 0 auto;
}
.fixed {
	z-index: 30;
	position: fixed;
	left: 0;
	top: 0;
	background-color: #fff;
	box-shadow: 0 10rpx 20rpx -5rpx rgba(0, 0, 0, 0.06);
}
.diyheight{
	height: 120rpx;
	height: calc(120rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
	height: calc(120rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
}
.page-footer {
	position: fixed;
	bottom: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: space-around;
	width: 100%;
	height: 120rpx;
	height: calc(120rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
	height: calc(120rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
	box-sizing: border-box;
	border-top: 1px solid #F3F3F3;
	background-color: #fff;
	box-shadow: 0px 0px 17rpx 1rpx rgba(206, 206, 206, 0.32);
	padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
	padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
	&.filter{
		filter: blur(2rpx);
	}
	.foot-item {
		display: flex;
		width: max-content;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		position: relative;
		line-height: 50rpx;
		padding: 0 30rpx;
		position: relative;
		.count-num {
			position: absolute;
			display: flex;
			justify-content: center;
			align-items: center;
			width: 40rpx;
			height: 40rpx;
			top: 0rpx;
			right: -15rpx;
			color: #fff;
			font-size: 20rpx;
			background-color: #FD502F;
			border-radius: 50%;
			padding: 4rpx;
		}
		.remind_tips {
			position: absolute;
			background-color: red;
			border-radius: 50%;
			width: 40rpx;
			height: 40rpx;
			color: #fff;
			display: flex;
			align-items: center;
			justify-content: center;
			right: 10rpx;
			top: -20rpx;
			font-size: 24rpx;
		}
	}
	.foot-item image {
		height: 50rpx;
		width: 50rpx;
		text-align: center;
		margin: 0 auto;
	}
	.foot-item .foot-item-add {
		width: 120rpx;
		height: 120rpx;
		// margin-bottom: 70rpx;
	}
	.foot-item .txt {
		font-size: 26rpx;
	}
}

.common-content {
	margin: 20rpx 30rpx 0;
}
.common-content-margin {
	padding: 20rpx 30rpx 0;
	background-color: #fff;
}
.common-head {
	display: flex;
	flex-wrap: initial;
	align-items: center;
	.common-title {
		margin-right: auto;
		position: relative;
		&:before {
			content: "";
			display: inline-block;
			width: 100%;
			height: 20rpx;
			background-color: #FFE103;
			position: absolute;
			bottom: 0rpx;
		}
		.common-title-name {
			font-size: 36rpx;
			font-weight: 500;
			color: #2C2C2C;
			line-height: 46rpx;
			position: relative;
		}
	}
	.common-children-t {
		display: flex;
		align-items: center;
		.common-children-title {
			font-size: 30rpx;
			font-weight: bold;
			color: #2C2C2C;
			line-height: 44rpx;
			margin-right: 10rpx;
		}
		.common-children-title-on {
			font-weight: 500;
		}
	}
	.common-head-more {
		width: 20rpx;
		height: 32rpx;
		image {
			width: 20rpx;
			height: 32rpx;
		}
	}
}

// 旧推荐用户
.list_user_content {
	margin-top: 30rpx;
}
.swiper_list_user {
	height: 310rpx;
}
/* .list_user {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-gap: 20rpx; */
	// height: 80%!important;
	.list-user {
		width: fit-content;
		grid-gap: 10rpx;
		overflow-x: auto;
		display: flex;
		flex-wrap: nowrap;
		padding-bottom: 20rpx;
	}
	.list_user_item {
		background: #FFFFFF;
		border-radius: 8rpx;
		padding: 10rpx;
		text-align: center;
		overflow: hidden;
		border: 1rpx solid #ccc;
		border-radius: 10rpx;
		width: 180rpx;
		display: inline-block;
		.list_user_avatar {
			width: 98rpx;
			height: 98rpx;
			border-radius: 50%;
			margin: 0 auto;
			image {
				width: 98rpx;
				height: 98rpx;
				border-radius: 50%;
			}
		}
		.list_user_nickname {
			font-size: 26rpx;
			font-weight: 500;
			color: #37393A;
			// line-height: 42rpx;
			margin-top: 10rpx;
		}
		.list_user_label {
			font-size: 24rpx;
			font-weight: 400;
			color: #767676;
			// line-height: 34rpx;
			margin-top: 6rpx;
		}
		.tab-wx {
			background-color:#05C436;
			color: #fff;
			width: 70%;
			font-weight: bold;
			margin: 20rpx auto 0;
			padding: 10rpx 5rpx;
			/* position: absolute;
			left: 20%;
			right: 20%;
			bottom: -20rpx; */
			font-size: 28rpx;
			border-radius: 50rpx;
		}
	}
// }
// 旧推荐用户end
.article {
	font-size: 32rpx;
	margin-bottom: 20rpx;
  overflow: hidden; 
  text-overflow: ellipsis; 
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
	.article-item {
		margin-top: 20rpx;
	}
}
.list_circle_content {
	// display: flex;
	overflow-x: auto;
	// padding-bottom: 20rpx;
}
.red_envelope_reward {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 30;
	text-align: center;
	.red_envelope_ceng {
		background-color: rgba(0,0,0,0.6);
		width: 100%;
		height: 100%;
	}
	.red_envelope_ceng_img{
		width: 80%;
		margin-top: 30%;
		position: absolute;
		left: 10%;
		right: 10%;
	}
}
// 新用户推荐
.news-rd-u {
	background-color: #fff;
	padding: 20rpx 30rpx;
	margin: 10rpx 0;
	.news-rd-u-ad image {
		height: 148rpx;
	}
	.news-rd-ulist {
		.swiper_list_user {
			flex: 1;
		}
		.news-rd-u-more {
			width: 26rpx;
			height: 42rpx;
		}
	}
}
// 新用户推荐end
// 需求推送推弹窗通知
.demand-msg-popup {
	position: fixed;
	top: 0;
	left: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0,0,0,0.5);
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	.demand-msg-swiper {
		background-color: #fff;
		width: 480rpx;
		height: 640rpx;
		padding: 30rpx;
		box-shadow: 0rpx 10rpx 28rpx 0rpx rgba(141, 138, 127, 0.1);
		border-radius: 24rpx;
		box-sizing: border-box;
		position: relative;
		.demand-msg-swiper-item {
			.demand-msg-close {
				position: absolute;
				top: 10rpx;
				right: 10rpx;
				image {
					width: 70rpx;
					height: 70rpx;
				}
			}
			.demand-msg-user {
				display: flex;
				align-items: center;
				.demand-msg-user-avatar {
					image {
						width: 100rpx;
						height: 100rpx;
						border-radius: 50%;
					}
				}
				.demand-msg-user-info {
					flex: 1;
					overflow: hidden;
					margin-left: 20rpx;
					.demand-msg-user-name {
						font-size: 36rpx;
					}
				}
			}
			.demand-msg-title {
				margin-top: 50rpx;
				font-size: 56rpx;
				font-weight: 550;
			}
			.demand-msg-content {
				font-weight: 550;
				font-size: 36rpx;
				margin-top: 30rpx;
			}
			.demand-msg-btn {
				font-weight: bold;
				font-size: 42rpx;
				margin: 30rpx auto 0;
				background-color: #FFE103;
				width: -webkit-fit-content;
				width: fit-content;
				padding: 15rpx 60rpx;
				border-radius: 50rpx;
			}
		}
	}
}
// 需求推送推弹窗通知end

// 展示用户手机号/微信弹窗
.popup_user_contact {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0,0,0,0.5);
	z-index: 35;
	display: flex;
	align-items: center;
	justify-content: center;
	.popup_user_contact_c { 
		width: 480rpx;
		background-color: #fff;
		border-radius: 20rpx;
		text-align: center;
		.popup_user_contact_h {
			padding: 30rpx 30rpx 80rpx;
			border-bottom: 1rpx solid #DDDDDD;
			.popup_user_contact_t {
				font-size: 36rpx;
				font-weight: 550;
				color: #2C332D;
			}
			.popup_user_contact_u{
				font-size: 32rpx;
				font-weight: 550;
				color: #323232;
				margin-top: 32rpx;
				text {
					color: #F73D3B;
				}
			}
		}
		.popup_user_contact_b {
			padding: 20rpx 0;
			text-align: center;
			display: flex;
			flex-wrap: nowrap;
			align-items: center;
			.popup_user_contact_close {
				font-size: 28rpx;
				font-weight: 400;
				color: #666764;
				line-height: 40rpx;
				flex: 1;
			}
			.popup_user_contact_copy {
				font-size: 28rpx;
				font-weight: 400;
				color: #323232;
				line-height: 40rpx;
				border-left: 1rpx solid #DDDDDD;
				flex: 1;
			}
		}
	}
}
// 展示用户手机号/微信弹窗end
// VIP弹窗
.user_vip_back {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	z-index: 35;
}
.user_vip_content {
	background-color: #fff;
	position: fixed;
	top: 30%;
	left: 50rpx;
	right: 50rpx;
	z-index: 35;
	border-radius: 30rpx;
	padding: 30rpx;
	text-align: center;
	.user_vip_close {
		position: absolute;
		right: 10rpx;
		top: 10rpx;
		image {
			width: 70rpx;
			height: 70rpx;
		}
	}
	.user_vip_icon {
		margin: 0 auto;
		image {
			width: 140rpx;
			height: 130rpx;
			margin: 0 auto;
			display: block;
		}
	}
	.user_vip_tit  {
		margin-top: 20rpx;
	}
	.user_vip_messag {
		font-size: 32rpx;
		margin-top: 30rpx;
	}
	.user_vip_btn {
		font-weight: bold;
		background-color: #FDE515;
		display: inline-block;
		padding: 10rpx 50rpx;
		border-radius: 10rpx;
		margin-top: 30rpx;
		font-size: 42rpx;
	}
}
// VIP弹窗end
// 我的客户
.my-card {
	position: fixed;
	right: 0;
	top: 74%;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 26rpx;
	color: #fff;
	font-weight: bold;
	background-color: #FB2C26;
	border-radius: 10rpx 0 0 10rpx;
	padding: 10rpx;
	writing-mode: vertical-rl;
}
.user-card-back {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0,0,0,0.5);
	z-index: 31;
}
.user-card-image {
	position: fixed;
	left: 100rpx;
	top: 15%;
	width: 550rpx;
	z-index: 32;
	border-radius: 30rpx;
	text-align: center;
	image {
		width: 100%;
	}
	.user-card-tips {
		margin-top: 20rpx;
		color: #fff;
		font-weight: bold;
		font-size: 28rpx;
	}
	.user-card-btn {
		display: flex;
		align-items: center;
		flex-direction: space-between;
		grid-gap: 30rpx;
	}
	.user-card-save {
		margin: 20rpx auto 0;
		// width: 300rpx;
		flex: 1;
		height: 80rpx;
		background: #FFE103;
		border-radius: 32rpx;
		font-size: 34rpx;
		font-weight: 600;
		color: #1C211D;
		line-height: 80rpx;
		text-align: center;
	}
}
.my-customer {
	position: fixed;
	right: 0;
	top: 83%;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 30rpx;
	color: #fff;
	font-weight: bold;
	background-color: #FB2C26;
	border-radius: 10rpx 0 0 10rpx;
	padding: 10rpx;
	writing-mode: vertical-rl;
}
// 顶部奖励播报
.slider-container {
    width: 100%;
    overflow: hidden;
    position: fixed;
    top: 60rpx;
    left: 0;
    z-index: 10;
}

.slider-track {
    display: flex;
    animation: slide 120s linear infinite; /* 指定动画时长为 10 秒 */
}

.slider-item {
    flex: 0 0 auto;
    width: fit-content;
    background: rgba(96, 124, 1, 0.5);
    text-align: center;
    font-size: 24rpx;
    display: flex;
    align-items: center;
    padding: 10rpx;
    border-radius: 20rpx;
    margin: 1rpx 40rpx;
	color: #fff;
}

.slider-item-image {
    display: flex;
}

.slider-item-image image {
    width: 30rpx;
    height: 30rpx;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }
    100% {
        /* 根据实际情况动态计算移动距离 */
        transform: translateX(calc(-220rpx * 30));
    }
}
// 顶部奖励播报end
</style>
